<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>SnapShotControl v1.0 Reference</title>
    <link rel="stylesheet" type="text/css" href="http://code.google.com/css/codesite.css"></link>
    <link rel="stylesheet" type="text/css" href="../../util/docs/template/local_extensions.css"></link>
  </head>
  <body>
    <h1>SnapShotControl</h1>
    <p>
<p>This library makes it easy to generate an image "snapshot" of yourinteractive map, using the Google Static Maps API.</p><p>The default behavior adds a control to the map,and then shows a popup with the snapshot when the control is clicked.However, the control can be hidden and the generatedsnapshot URLs can be programmatically retrieved, so the library may be usedin a more flexible manner.</p><p>This control can detect the standard overlays (GMarker, GPolygon, GPolyline)and render them in the snapshot, and in the case of a poly with many points,it can pass in the points as an encoded string, resulting in a shorter URL.</p><p>The control will attempt to sense everything about the map and overlays,within the limits of what the API offers accessors for.For example, if the the filename of a marker's icon is "marker_greenA.png",then this control will parse that and set the parameters accordingly.If you want the control to maintain the style of polys, you mustset additional properties on each poly object: ssColor, ssWeight, ssOpacity,and for polygons, ssFillColor and ssFillOpacity.</p><p>Various options can be sent into the constructor to change the defaultrendering of the snapshot.</p></p>
    <p>For a description and examples of how to use this library, check out the <a href="examples.html">how-to</a>.</p>
    
      <h2><a name="SnapShotControl"></a>class SnapShotControl</h2>
      <p></p>
      
        <h3>Constructor</h3>
        <table summary="class SnapShotControl - Constructor" width="90%">
          
          <tbody>
            <tr>
              <th>Constructor</th>
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>SnapShotControl(<span class="type">opt_opts?:SnapShotControlOptions</span>)</code></td>
                
                <td>Creates a control with options specified in <code><a href="reference.html#SnapShotControlOptions">SnapShotControlOptions</a></code>.</td>
              </tr>
            
          </tbody>
        </table>
      
        <h3>Methods</h3>
        <table summary="class SnapShotControl - Methods" width="90%">
          
          <tbody>
            <tr>
              <th>Methods</th>
              
                
                  <th>Return&nbsp;Value</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>getImage(<span class="type">mapCenterPos?:GLatLng</span>)</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>Generate new URL for snapshot. If no center is passed in, then it uses the center of the map. If the center is set to false, then the center of the snapshot is auto-calculated based on the overlay positions.</td>
              </tr>
            
              <tr class="even">
                <td><code>getImageUrl()</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>The most recently generated URL.</td>
              </tr>
            
              <tr class="odd">
                <td><code>hide()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Change visibility of the control to hidden.</td>
              </tr>
            
              <tr class="even">
                <td><code>isHidden()</code></td>
                
                  
                    <td><code>Boolean</code></td>
                  
                
                <td>Returns true when the control is hidden.</td>
              </tr>
            
              <tr class="odd">
                <td><code>isMobile(<span class="type">mobile:Boolean</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify whether to use mobile optimized tiles.</td>
              </tr>
            
              <tr class="even">
                <td><code>setFormat(<span class="type">format:String</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify image format. The options are "gif," "jpg," "jpg-baseline," "png8," "png32".</td>
              </tr>
            
              <tr class="odd">
                <td><code>setLanguage(<span class="type">language:String</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify language for snapshot's copyright texts.</td>
              </tr>
            
              <tr class="even">
                <td><code>setMapSize(<span class="type">mapSize:GSize</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify size for snapshot.</td>
              </tr>
            
              <tr class="odd">
                <td><code>setMapType(<span class="type">mapType:String</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify maptype for snapshot. The options are "roadmap", "satellite", "hybrid", "terrain" or auto-detect("").</td>
              </tr>
            
              <tr class="even">
                <td><code>show()</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Change visibility of the control to visible.</td>
              </tr>
            
              <tr class="odd">
                <td><code>showPopup(<span class="type">mapCenterPos?:GLatLng</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Generate new snapshot URL and show popup with image and URL.</td>
              </tr>
            
              <tr class="even">
                <td><code>usePolylineEncode(<span class="type">useEncode:Boolean</span>)</code></td>
                
                  
                    <td><code>None</code></td>
                  
                
                <td>Specify whether to use polyline encoding.</td>
              </tr>
            
          </tbody>
        </table>
      
    
      <h2><a name="SnapShotControlOptions"></a>class SnapShotControlOptions</h2>
      <p>This class represents optional arguments to <code><a href="reference.html#SnapShotControl">SnapShotControl</a></code>.  There is no constructor for this class.  Instead, this class is instantiated as a javascript object literal.</p>
      
        <h3>Properties</h3>
        <table summary="class SnapShotControlOptions - Properties" width="90%">
          
          <tbody>
            <tr>
              <th>Properties</th>
              
                
                  <th>Type</th>
                
              
              <th>Description</th>
            </tr>
            
              <tr class="odd">
                <td><code>buttonLabelHtml</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>Specify label HTML of   control button.  The default value is <code> "Say cheese!"</code>.</td>
              </tr>
            
              <tr class="even">
                <td><code>format</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>Specify image format for snapshot. You can choice one from "gif", "jpg", "jpg-baseline", "png8", "png32".  The default value is <code> "gif"</code>.</td>
              </tr>
            
              <tr class="odd">
                <td><code>hidden</code></td>
                
                  
                    <td><code>Boolean</code></td>
                  
                
                <td>Specify visibility when control is added to the map. If it is set to true, the button is hidden.  The default value is <code> false</code>.</td>
              </tr>
            
              <tr class="even">
                <td><code>language</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>Specify language for snapshot's copyrights. If it is not set, then this library detects the language of the map.  The default value is <code> ""</code>.</td>
              </tr>
            
              <tr class="odd">
                <td><code>maptype</code></td>
                
                  
                    <td><code>String</code></td>
                  
                
                <td>Specify maptype for snapshot. The options are "roadmap", "satellite", "hybrid", "terrain". If it is not set, then the control detects the type of the map.  The default value is <code> ""</code>.</td>
              </tr>
            
              <tr class="even">
                <td><code>mobile</code></td>
                
                  
                    <td><code>Boolean</code></td>
                  
                
                <td>Specify whether to use mobile optimized tiles for snapshot. Useful for mobile devices. This property is ignored, when the <code>style</code> property is not set to "roadmap".  The default value is <code> false</code>.</td>
              </tr>
            
              <tr class="odd">
                <td><code>useAutoDetectMarker</code></td>
                
                  
                    <td><code>Boolean</code></td>
                  
                
                <td>If it is set to true, the control attempts to auto detect the marker color, label, and size, based on standard image naming conventions.  The default value is <code> true</code>.</td>
              </tr>
            
              <tr class="even">
                <td><code>usePolylineEncode</code></td>
                
                  
                    <td><code>Boolean</code></td>
                  
                
                <td>Specify whether to   use encoded polys in the snapshot. Useful if you're sending in a big poly,  and want to stay within URL limits.  The default value is <code> false</code>.</td>
              </tr>
            
          </tbody>
        </table>
      
    
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
    <script type="text/javascript">
      _uacct = "UA-964209-4";
      urchinTracker();
    </script> 
  </body>
</html>
